package test.study.cv.opencv;

import lombok.extern.slf4j.Slf4j;
import org.junit.Before;
import org.junit.Test;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.imgcodecs.Imgcodecs;

@Slf4j
public class Tes {

    private String inputFile = "d:/image/test2.png";

    private String outputFile = "d:/image/test2_gray.png";

    @Before
    public void init() {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    }

    /**
     * 灰度
     */
    @Test
    public void gray_test() {
        //读取原始图像
        Mat src = Imgcodecs.imread("d:/image/submat.png");
        //3.分辨率=宽 * 高
        //2.行=高 列=宽
        int rows = src.rows();
        int cols = src.cols();

        log.info("{}, {}", rows, cols);
    }
}
